package com.wangp.employee.controller;

import com.wangp.employee.dto.DevelopmentQueryReqDTO;
import com.wangp.employee.dto.DevelopmentQueryRespDTO;
import com.wangp.employee.dto.DevelopmentSaveReqDTO;
import com.wangp.employee.dto.DevelopmentSaveRespDTO;
import com.wangp.employee.service.DevelopmentService;

import com.wangp.procurement.model.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 第一行简要描述.
 * </p>
 *
 * @author wangping
 * @since 2024-12-19
 */

@RestController
@RequestMapping("/development")
public class DevelopmentController {

    @Autowired
    private DevelopmentService developmentService;

    /**
     * 查询部门表
     * @param developmentQueryReqDTO
     * @return
     */
    @PostMapping("/manage")
    public Result<DevelopmentQueryRespDTO> list(@RequestBody DevelopmentQueryReqDTO developmentQueryReqDTO) {
        return Result.ok(developmentService.queryPage(developmentQueryReqDTO));
    }


    @PostMapping("/save")
    public Result<DevelopmentSaveRespDTO> inster(@RequestBody DevelopmentSaveReqDTO saveReqDTO) {
        developmentService.saveDepartmentWithEmp(saveReqDTO);
        return Result.ok();
    }



}
